package com.qf.homework.mvc.controller;

import com.qf.homework.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController{
    @RequestMapping("/r")
    public String addUser(User user){
        return "redirect:/h/l";
    }
    @RequestMapping("/d")
    public String delUser(Integer id){
        return "redirect:/h/l";
    }
    @RequestMapping("/l")
    public String listUser(){
        return "redirect:/h.html";
    }
    @RequestMapping("/login")
    public String login(String value){
        if (value.equals("jack")){
            return "1";
        }
        return "0";  }
}
